$(function () {

    $('[rel="popover"]').popover({

        html : true,
        delay:{  hide: 1000 },

        content: function() {
            return $('#popover_content_wrapper').html();
        }

    });
    $('[data-toggle="popover"]').popover();

    window.addEventListener('scroll',debounce(scrollTop,400));


})

function scrollTop() {
    var scrollTop = $(window).scrollTop();

    //console.log(scrollTop);
   /* if (scrollTop>700) {
        $('#top').css("display","none");
        $('#my-brand').attr("src","images/logoZ.png");
        $('#my-nav').css("border-bottom","4px solid #00ccff");
        $('label.animate').css("margin-bottom","0");
    }else {
        $('#top').css("display","block");
        $('#my-brand').attr("src","images/logoZ.png");
        $('#my-nav').css("border-bottom","none");
        //$('label.animate').css("margin-bottom",".5rem");
    }*/
}
// 简单的防抖动函数
function debounce(func, wait) {
    // 定时器变量
    var timeout;
    return function() {
        // 每次触发 scroll handler 时先清除定时器
        clearTimeout(timeout);
        // 指定 xx ms 后触发真正想进行的操作 handler
        timeout = setTimeout(func, wait);
    };
};